package se.thoka.twt.client.users;

import com.google.gwt.event.shared.GwtEvent;

public class UserUpdatedEvent<U extends AbstractUser> extends GwtEvent<UserUpdatedHandler<U>> {
	
	static Type<UserUpdatedHandler<?>> TYPE = new Type<UserUpdatedHandler<?>>();
	
	private U user;
	public UserUpdatedEvent(U user) {
		this.user = user;
	}
	
	public U getUser() {
		return user;
	}

	@SuppressWarnings({ "unchecked", "rawtypes" })
	@Override
	public Type<UserUpdatedHandler<U>> getAssociatedType() {
		return (Type) TYPE;
	}

	@Override
	protected void dispatch(UserUpdatedHandler<U> handler) {
		handler.onUserUpdated(this);
	}

	
}
